package com.nineclock.system.controller;

import com.nineclock.common.entity.Result;
import com.nineclock.system.SysCompanyContactConfigController.SysDepartmentControllerApi;
import com.nineclock.system.service.SysDepartmentDTOService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/department")
public class SysDepartmentController implements SysDepartmentControllerApi {

    @Autowired
    private SysDepartmentDTOService sysDepartmentDTOService;

    /***
     * 获取企业员工所属的部门
     *
     */

    @GetMapping("/queryDepartmentsByUserId")
    @Override
    public Result<List<Long>> queryDepartmentsByUserId(@RequestParam("companyUserId") Long companyUserId) {

        List<Long> ids  =sysDepartmentDTOService.queryDepartmentsByUserId(companyUserId);
        return Result.success(ids);
    }
}
